<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">











<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>NPanday - Importing Projects</title>
    <style type="text/css" media="all">
      @import url("../../css/maven-base.css");
      @import url("../../css/maven-theme.css");
      @import url("../../css/site.css");
    </style>
    <link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
          </head>
  <body class="composite">
    <div id="banner">
                  <a href="" id="bannerLeft">
    
                                            <img src="../.././images/NPanday.png" alt="" />
    
            </a>
                        <a href="http://www.codeplex.com/" id="bannerRight">
    
                                            <img src="../.././images/logo-home.png" alt="" />
    
            </a>
            <div class="clear">
        <hr/>
      </div>
    </div>
    <div id="breadcrumbs">
          
  

  
    
            
  
    
            <div class="xleft">
          
                <a href="http://npanday.codeplex.com/" class="externalLink">NPanday Home</a>
                &gt;
      
                <a href="../../">NPanday 1.2</a>
                  </div>
            <div class="xright">      
  

  
    
            
  
    
             Last Published: 22 Jun 2010
              &nbsp;| Version: 1.2
            </div>
      <div class="clear">
        <hr/>
      </div>
    </div>
    <div id="leftColumn">
      <div id="navcolumn">
           
  

  
    
            
  
    
                   <h5>General Info</h5>
            <ul>
              
    <li class="none">
                    <a href="../../index.html">NPanday Overview</a>
          </li>
              
    <li class="none">
                    <a href="../../release-notes.html">NPanday Release Notes</a>
          </li>
              
    <li class="none">
                    <a href="../../faqs.html">NPanday FAQs</a>
          </li>
              
    <li class="none">
                    <a href="../../faqs.html">NPanday Features</a>
          </li>
              
    <li class="none">
                    <a href="../../npanday.pdf">Documentation PDF</a>
          </li>
          </ul>
              <h5>User's Guide</h5>
            <ul>
              
    <li class="none">
                    <a href="../.././guide/index.html">Introduction</a>
          </li>
              
    <li class="none">
                    <a href="../.././guide/installation/index.html">Installation</a>
          </li>
              
    <li class="none">
                    <a href="../.././guide/vs/index.html">Visual Studio Add-in</a>
          </li>
              
    <li class="none">
                    <a href="../.././guide/maven/index.html">Maven Command Line</a>
          </li>
              
    <li class="none">
                    <a href="../.././guide/devinfra/index.html">Maven Development Infrastructure</a>
          </li>
              
    <li class="none">
                    <a href="../../plugins/index.html">NPanday Plugins</a>
          </li>
          </ul>
              <h5>Contributing</h5>
            <ul>
              
    <li class="none">
                    <a href="../.././developers/index.html">Developer's Guide</a>
          </li>
              
    <li class="none">
                    <a href="../.././issue-tracking.html">Issue Tracking</a>
          </li>
              
    <li class="none">
                    <a href="../.././mail-lists.html">Mailing Lists</a>
          </li>
          </ul>
              <h5>Project Documentation</h5>
            <ul>
              
                
              
      
            
      
            
      
            
      
            
      
            
      
            
      
              
        <li class="collapsed">
                    <a href="../../project-info.html">Project Information</a>
                </li>
          </ul>
              <h5>Resources</h5>
            <ul>
              
    <li class="none">
                    <a href="http://maven.apache.org/" class="externalLink">Apache Maven</a>
          </li>
              
    <li class="none">
                    <a href="http://npanday.codeplex.com/" class="externalLink">NPanday on CodePlex</a>
          </li>
          </ul>
                                           <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
            <img alt="Built by Maven" src="../../images/logos/maven-feather.png"></img>
          </a>
                       
  

  
    
            
  
    
        </div>
    </div>
    <div id="bodyColumn">
      <div id="contentBox">
        <div class="section"><h2>Importing Projects</h2>
<p>This section provides more details on how on importing a Visual Studio project using the <i>Generate Solution's POM Information...</i> feature works. As we saw in the <a href="./quickstart.html"> Quickstart example</a>, this feature will generate <tt>pom.xml</tt> files from an existing Visual Studio solution file. The generated <tt>pom.xml</tt> file will contain the latest versions of the artifact dependencies used for the project.</p>
<p><b>Note</b>: ASP.NET MVC should be installed to get the proper behavior when importing projects especially those projects with unsupported project types. See <a href="./importing.html#MVC"> MVC projects</a> for more details.</p>
<p>To import a project, first select <i>Generate Solution's POM Information...</i> from the project's context menu:</p>
<img src="../../images/vs/generate-pom.jpg" /><p>In the pop-up screen, Browse to the directory location of the parent solution file to use.</p>
<p>The <i>Group ID</i> is generated by default with the format of <tt>[company_id].[solution_name]</tt>.</p>
<p>The <i>SCM Tag</i> is optional. If you provide a url that is not reachable (e.g: it is authenticated and the credentials are not supplied or incorrect) by the Addin, you will see a warning, but the url will still be added to the parent pom. </p>
<img src="../../images/vs/import-dialog.jpg" alt="Importing parent solution file" /><p>When you are ready, click <i>Generate POMs</i>.</p>
<p>Underscores and spaces in the artifact's Group ID are automatically deleted when added to the project's <tt>pom.xml</tt>. The table below shows the conversion of certain values of groupIds.</p>
<table class="bodyTable"><tbody><tr class="a"><td align="left"><b>Artifact Group Id</b></td>
<td align="left"><b>Converted Group Id</b></td>
</tr>
<tr class="b"><td align="left">The.Project</td>
<td align="left">The.Project</td>
</tr>
<tr class="a"><td align="left">the.project</td>
<td align="left">the.project</td>
</tr>
<tr class="b"><td align="left">the project</td>
<td align="left">TheProject</td>
</tr>
<tr class="a"><td align="left">the_project</td>
<td align="left">TheProject</td>
</tr>
</tbody>
</table>
<p>Next, the project unit tests window will appear. If you have modules that are for unit tests only, select them and click OK.</p>
<img src="../../images/vs/unit-tests.png" alt="Project unit tests list" /><p><tt>pom.xml</tt> files will be generated for all the projects that are included in the solution file, including the parent project and its sub-projects, if there are any.</p>
<p><b>Note</b>: The Units Tests window is not displayed when importing unsupported project types. Hence, an unsupported project type warning is displayed. For multi-module projects with supported and/or unsupported project types, the supported projects are included in the parent POM while for the unsupported project types, these are not included in the parent POM, and a warning is displayed.</p>
<p>For projects with web references, the <tt>pom.xml</tt> generated will contain <tt>maven-wsdl-plugin</tt> configuration similar to the following:</p>
<div class="source"><pre>  &lt;plugin&gt;
    &lt;groupId&gt;npanday.plugin&lt;/groupId&gt;
    &lt;artifactId&gt;maven-wsdl-plugin&lt;/artifactId&gt;
    &lt;extensions&gt;true&lt;/extensions&gt;
    &lt;executions&gt;
      &lt;execution&gt;
        &lt;goals&gt;
          &lt;goal&gt;wsdl&lt;/goal&gt;
        &lt;/goals&gt;
      &lt;/execution&gt;
    &lt;/executions&gt;
    &lt;configuration&gt;
      &lt;webreferences&gt;
        &lt;webreference&gt;
          &lt;namespace&gt;AnotherWebService&lt;/namespace&gt;
          &lt;path&gt;Web References/AnotherWebService/AnotherWS.wsdl&lt;/path&gt;
          &lt;output&gt;Web References/AnotherWebService/&lt;/output&gt;
        &lt;/webreference&gt;
      &lt;/webreferences&gt;
    &lt;/configuration&gt;
  &lt;/plugin&gt;</pre>
</div>
<p>The wsdl goal is the one responsible for building and creating webservice proxy classes. And, all the web references used in the project are listed inside the <tt> &lt;webreferences&gt; </tt> tag. For more instructions on adding, renaming, and deleting web references, refer to <a href="./webReferences.html"> Web References</a> section of this guide.</p>
<p>Other project types will generate corresponding plugins needed to build that type of project (for example, the compile plugin, aspx plugin, or msbuild plugin).</p>
<div class="section"><h3>Importing Projects with Resource Files</h3>
<p>If the project you are importing includes a resource file, the <tt>maven-resgen</tt> plugin is added to <tt>pom.xml</tt> during import.</p>
<p>In the plugin's configuration, you can find the list of resource (<tt>resx</tt>) files with corresponding names. By default, <tt>RootNamespace</tt> is the assembly name and <tt>RootNamespace.Filename</tt> is the filename of the <tt>resx</tt> files.</p>
<p>To ensure that the plugin works, the following are required:</p>
<ul><li>The classname and the filename of the item that contains the resx files must have the same name. Example: <tt>&quot;public class frmMaestroName&quot; = frmMaestroName.resx = frmMaestroName.cs</tt><p><b>Note</b>: Changing the codefile(.cs/.vb) automatically updates the resource(resx) file. In some instances, however, this does not hold true.</p>
</li>
<li>The namespace of the project should be equal to the DefaultNamespace of the project assembly. To check the default name,<ul><li>Right-click on the project and select Properties. This displays a project property window.</li>
<li>Select the Application tab.</li>
<li>In the DefaultNamespace field, you will find <tt>RootNamespace</tt>.</li>
</ul>
</li>
</ul>
<p>Once the above requirements are met, the importer automatically does the work and there is no need to edit <tt>pom.xml</tt>.</p>
<p>Removing the configuration part of the <tt>maven-resgen</tt> plugin allows the plugin to locate all the resx files and compile them as <tt>ArtifactId.Filename</tt>. If you set the namespace as the artifactId, you do not need to list all the resx files in the <tt>pom.xml</tt>.</p>
<p><b>Note</b>: This feature does not support cultured esx files such as <tt>eu-US</tt>, <tt>it</tt>, <tt>jp</tt>, <tt>de</tt>, <tt>eu-UK</tt>, and even custom culture.</p>
</div>
<div class="section"><h3>Importing WPF/WCF Projects with XAML files</h3>
<p>If the project you are Importing is a WPF/WCF project and it contains a XAML file the MSBuildPlugin will be automatically added into that project's pom file.</p>
<div class="source"><pre>  &lt;plugin&gt;
    &lt;groupId&gt;npanday.plugin&lt;/groupId&gt;
    &lt;artifactId&gt;NPanday.Plugin.Msbuild.JavaBinding&lt;/artifactId&gt;
    &lt;executions&gt;
      &lt;execution&gt;
        &lt;goals&gt;
          &lt;goal&gt;compile&lt;/goal&gt;
        &lt;/goals&gt;
      &lt;/execution&gt;
    &lt;/executions&gt;
  &lt;/plugin&gt;</pre>
</div>
<p>This will generate the needed *.g.cs/*.g.vb files that are needed for those XAML files. </p>
<p><b>Note:</b> The user would encounter double dependency errors, if the project was created with 3.0 .NET framework. We suggest that you change your framework to 3.5 and then delete the references that are already included as defaults in NPanday. This will then allow your project to run successfully.</p>
</div>
<div class="section"><h3>Importing ASP.NET <a name="MVC">MVC</a> Projects</h3>
<p>As of NPanday 1.1, MVC projects are not support for import as Maven projects from the Visual Studio Add-in. However, in some situations they may be incorrectly imported as a normal C# or VB project.</p>
<p>To avoid this problem, make sure you have installed ASP.NET MVC Release Candidate 2 which can be obtained from <a class="externalLink" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ee4b2e97-8a72-449a-82d2-2f720d421031&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?FamilyID=ee4b2e97-8a72-449a-82d2-2f720d421031&amp;displaylang=en</a>.</p>
<p>This must be installed to skip the unsupported project types and be able to get the correct project type GUID.</p>
</div>
<div class="section"><h3>Summary</h3>
<p>This section has described how to import a project, and the nuances of various different supported project types.</p>
<p>You can now read on about <a href="./executeGoals.html"> executing Maven goals</a>, or go back to the <a href="./index.html"> index</a>.</p>
</div>
</div>

      </div>
    </div>
    <div class="clear">
      <hr/>
    </div>
    <div id="footer">
      <div class="xright">&#169;  
          2010
    
          NPanday
          
  

  
    
            
  
    
  </div>
      <div class="clear">
        <hr/>
      </div>
    </div>
  </body>
</html>
